﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;

namespace DXTools.UI.Core.Dialogs
{
    public partial class ProgressDialog : ChildWindow
    {
        //public string Title
        //{
        //    get { return this.Title; }
        //    set { this.Title = value; }
        //}

        public string Message
        {
            get { return this.txtMessage.Text; }
            set { this.txtMessage.Text = value; }
        }

        public double ProgressValue
        {
            get { return this.ProgressBar.Value; }
            set { this.ProgressBar.Value = value; }
        }

        public bool CanClose 
        {
            get { return this.CloseButton.IsEnabled ; }
            set { this.IsEnabled = value; }
        }

        public ProgressDialog()
        {
            InitializeComponent();

            CanClose = false;
        }

        public void ShowDialog()
        {
            this.Show();
        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        //private void EmailButton_Click(object sender, RoutedEventArgs e)
        //{
        //    HtmlPage.Window.Navigate(new Uri("mailto:support@dynamicsxrmtools.com?subject=Error details&body="+HttpUtility.HtmlEncode(this.Message)));
        //}
    }
}

